package com.device.repository;

import com.device.dto.SubDeviceDTO;
import com.device.entity.SubDevice;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.UUID;

@Repository
public interface SubDeviceRepository extends JpaRepository<SubDevice, UUID> {
    
    List<SubDevice> findByMainDeviceImeiOrderByCreatedTimeDesc(String mainDeviceImei);
    
    boolean existsBySubDeviceId(String subDeviceId);
    
    SubDevice findBySubDeviceId(String subDeviceId);
    
    long countBySubDeviceId(String subDeviceId);
}